#include <QApplication>
#include "..\ChartViewEx\ccurvedata.h"
#include "..\ChartViewEx\chartviewex.h"
#include "..\ChartViewEx\chartviewex_global.h"


int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    ChartViewEx *chartView = new ChartViewEx();

	chartView->setChartName("Chart A");
	chartView->setXAxisName("X Value");
	chartView->setYAxisName("Y Value");

    CCurveData *data =new CCurveData();
    QList<float> pxValue;
    pxValue<<2<<4<<8<<13<<17<<20;

    QList<float> pyValue;
    pyValue<<-20<<10<<20<<30<<-15<<2;
    data->SetData(pxValue,pyValue);
    chartView->addCurveData(data);

    pxValue.clear();
    pyValue.clear();
    pxValue<<3<<4<<8<<13<<17<<18;
    pyValue<<10<<4<<7<<5<<15<<9;

    CCurveData *data1 =  new CCurveData();
    
    chartView->addCurveData("Test_B",pxValue,pyValue,Qt::red);

	chartView->setWindowTitle("Simple Line Chart");
	chartView->setRenderHint(QPainter::Antialiasing);
	chartView->setAxisXDecimalNumber("%.2f");
	chartView->setAxisYDecimalNumber("%.2f");
	chartView->resize(800,400);
	chartView->show();

    return a.exec();
}
